package controllers

import (
	"encoding/json"
	"fmt"
	"os"

	"github.com/astaxie/beego"
)

type MainController struct {
	beego.Controller
}

// 读取配置文件
func readConfJson() {
	fileData, err := os.ReadFile("your_file.json")
	if err != nil {
		fmt.Println("Error reading file:", err)
		return
	}
	confJson := make(map[string]interface{})
	err = json.Unmarshal(fileData, confJson)
	if err != nil {
		fmt.Println("Error parsing JSON:", err)
		return
	}
	fmt.Println(confJson)
}

// @router GetText [get]
func (c *MainController) GetText() {
	readConfJson()
}
